<?php if ($this->row[is_app] == 2):?>
<div class="alert alert-error">
	<a class="close" data-dismiss="alert" >&times;</a>
	提示：注意, 该车已经被卖家售出了！ <a href="<?= $this->url(array('controller'=>'buy','action'=>'index','query'=>$this->row[model]),null,true)?>">点这里搜索更多<?=$this->row[model]?>相关信息</a>
</div>
<?php endif;?>

<style type="text/css">

.car_color{
	<?php if ($this->row[color_value] == "#ffffff"):?>
	border-top: 3px solid #3072C5;
	<?php else: ?>
	border-top: 3px solid <?= $this->row[color_value]?>;
	<?php endif;?>
	
}
</style>
<div class="row-fluid buy_view">

<div class="span9" >
	   
    <div class="row-fluid">
        <h3>
            <img src="/car_ico/<?= $this->row[brand_icon]?>" /> 
            <span> <?= $this->row[title];?></span>
        </h3>
    </div>
    <div class="row-fluid">
        <div class="span12 car_color">
            <ul class="tools inline">
            	<li><a href="javascript:<?php if ($this->member):?>addFavorite(<?= $this->cid?>)<?php endif;?>;" data="<?= $this->url(array('controller'=>'dialog','action'=>'login','ref'=>$this->ref,'isre'=>1),null,true)?>" <?php if (!$this->member):?>id="showWindow"<?php endif;?>><i class="icon-heart"></i>收藏</a></li>
            	<li><a href="javascript:;" data="/dialog/erweima/cid/<?= $this->cid?>" id="showWindow"><i class="icon-qrcode"></i>保存到手机</a></li>
            	<li><a href="<?= $this->url(array('controller'=>'ajax','action'=>'savedesktop','cid'=>$this->cid,'title'=>$this->row[title]))?>" target="_blank"><i class="icon-download-alt"></i>保存到桌面</a></li>
            	<li id="bdshare" class="bdshare_t get-codes-bdshare"><a href="javascript:;" class="bds_more"><i class="icon-share-alt"></i>分享到</a></li>
            	<!-- li><a href="javascript:;" data="<?php if ($this->member):?>/dialog/jubao/cid/<?= $this->cid?><?php else :?><?= $this->url(array('controller'=>'dialog','action'=>'login','ref'=>$this->ref,'isre'=>1),null,true)?><?php endif;?>" id="showWindow"><i class="icon-exclamation-sign"></i>举报</a></li-->
                <li class="dropdown">
                	<a href="javascript:;" data-toggle="dropdown" id="buy_set"><i class="icon-cog"></i>管理</a>
		            <ul class="dropdown-menu" role="menu" aria-labelledby="buy_set">
		                <li><a href="javascript:<?php if ($this->member):?>refresh(<?= $this->cid?>)<?php endif;?>;" data="<?= $this->url(array('controller'=>'dialog','action'=>'login','ref'=>$this->ref,'isre'=>1),null,true)?>" <?php if (!$this->member):?>id="showWindow"<?php endif;?>><i class="icon-repeat"></i>刷新</a></li>
		                <li><a href="<?= $this->url(array('controller'=>'sale','action'=>'index','op'=>'edit','cid'=>$this->cid),null,true)?>" target="_blank"><i class="icon-pencil"></i>修改</a></li>
		                <li><a href="<?= $this->url(array('controller'=>'set','action'=>'profit','app'=>'zd','cid'=>$this->cid),null,true)?>" target="_blank"><i class="icon-arrow-up"></i>置顶</a></li>
		                <li><a href="<?= $this->url(array('controller'=>'set','action'=>'profit','app'=>'tg','cid'=>$this->cid),null,true)?>" target="_blank"><i class="icon-share-alt"></i>推广</a></li>
		            </ul>
    			</li>
            </ul>


            <div class="row-fluid">
                
                <div class="span6 car_img">
                    <a id="img_big" href="javascript:scrollTo('sp');">
                    	<div class="<?php if ($this->row[is_app] == 2):?>sale_icon<?php endif;?>"></div>
                    	<?php if ($this->ismobile):?>
                    		<img id="b_0" src="/img/noimg_small.gif" data-original="<?= $this->row[img_dir].$this->row[session_id].'/'.$this->row[session_id].str_replace('.', '_small.', $this->row[car_img])?>" />
                    	<?php else:?>
                        	<img id="b_0" src="/img/noimg_big.gif" data-original="<?= $this->row[img_dir].$this->row[session_id].'/'.$this->row[session_id].str_replace('.', '_big.', $this->row[car_img])?>" />
                    	<?php endif;?>
                    </a>
                    <hr />
                    <p>
                    <span>车辆编号: <?= $this->cid?> &nbsp;|&nbsp; 浏览: <?= $this->row[view]?>次</span>
                    <span class="pull-right">发布时间: <?= date("Y-m-d", $this->row[created_at])?></span>
                    </p>

                </div>

                
                <div class="span6 buy_right">
                    <h4>价格:<strong><?= $this->row[price]?></strong>万元
                    <?php if ($this->row[newprice] != 0):?>
                    <small><abbr class="initialism" title="厂商裸车售价">新车约:<?= $this->row[newprice]?>万元</abbr><a href="javascript:scrollTo('pz');">[配置]</a></small>
                    <?php endif;?>	
                    </h4>
                    
                    <table class="table table-striped table-hover">
	                    <tr>
	                    	<td>车辆颜色: </td>
	                    	<td><?= $this->row[color_name]?><i style="background-color:<?= $this->row[color_value]?>;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</i></td>
	                    </tr>
	                    <tr>
	                    	<td>上牌时间: </td>
	                    	<td><?= $this->row[car_year]."年".$this->row[car_month]."月";?></td>
	                    </tr>
	                    <tr>
	                    	<td>行驶里程: </td>
	                    	<td><?= $this->row[kilometer]?>公里</td>
	                    </tr>
	                    <?php if ($this->row[pailiang]):?>
	                    <tr>
	                    	<td>排量: </td>
	                    	<td><?= $this->row[pailiang]?></td>
	                    </tr>
	                    <?php endif;?>
	                    <?php if ($this->row[biansuxiang]):?>
	                    <tr>
	                    	<td>变速箱: </td>
	                    	<td><?= $this->row[biansuxiang]?></td>
	                    </tr>
	                    <?php endif;?>
	                    <tr>
	                    	<td>年检日期: </td>
	                    	<td>
	                    	<?php if ($this->row[check_year] == -1):?>
	                    		<?= "已过期"?>
	                    	<?php else:?>
	                    		<?= $this->row[check_year]."年".$this->row[check_month]."月"?>
	                    	<?php endif;?>
	                    	</td>
	                    </tr>
	                    <tr>
	                    	<td>保险日期: </td>
	                    	<td>
		                    <?php if ($this->row[safe_year] == -1):?>
	                    		<?= "已过期"?>
	                    	<?php else:?>
	                    		<?= $this->row[safe_year]."年".$this->row[safe_month]."月"?>
	                    	<?php endif;?>
	                    	</td>
	                    </tr>
	                    <tr>
	                    	<td>车辆类型: </td>
	                    	<td>
	                    	<?php if ($this->row[car_operate] == 0):?>
	                    		<?= "非营运"?>
							<?php elseif ($this->row[car_operate] == 1):?>
								<?= "营运"?>
							<?php elseif ($this->row[car_operate] == 2):?>
								<?= "营专非"?>
	                    	<?php endif;?>
	                    	</td>
	                    </tr>
	                    <tr>
	                    	<td>保养情况: </td>
	                    	<td>
	                    	<?php if ($this->row[maintenance] == 0):?>
	                    		<?= "4S店定期保养"?>
							<?php elseif ($this->row[maintenance] == 1):?>
								<?= "非4S店定期保养"?>
							<?php elseif ($this->row[maintenance] == 2):?>
								<?= "无定期保养"?>
	                    	<?php endif;?>
	                    	</td>
	                    </tr>
                    </table>
                    
                    
                    <p class="tel pull-right">
                        <span id="view_tel" class="tel-number"> <b> <?= $this->row[contact_user]?></b> <label>点击查看联系电话</label> </span> 
                    	<input type="hidden" value="<?= $this->cid?>" id="cid" />
                    </p>
                    <!-- p><a href="">查看此人发贴记录</a></p-->
                </div>
            </div>
                
            <div class="row-fluid">

                <div class="span12 img_view">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="javascript:;">车主自述</a></li>
                    </ul>
                    <p><?= $this->row[note]?></p>
                    <p>联系时，请说是在  <strong>淘车乐</strong> 上看到的，谢谢！</p>
                    <ul class="nav nav-tabs" id="sp">
                        <li class="active"><a href="javascript:;">车况实拍</a></li>
                    </ul>
                    <ul class="unstyled">
                    <?php foreach (unserialize($this->row[img_arr]) as $k=>$value):?>
                        <li>
                        <?php if ($this->ismoblie):?>
                        	<img width="90%" src="/img/noimg_small.gif" data-original="<?= $this->row[img_dir].$this->row[session_id].'/'.$this->row[session_id].str_replace('.', '_big.', $value)?>" id="aimg_<?= $k?>">
                        <?php else:?>
                        	<img width="90%" src="/img/noimg_huge.gif" data-original="<?= $this->row[img_dir].$this->row[session_id].'/'.$this->row[session_id].str_replace('.', '_huge.', $value)?>" id="aimg_<?= $k?>">
                        <?php endif;?>
                        </li>	
                    <?php endforeach;?>  
                   
                    </ul>
                    <?php if ($this->row[name_id] != -1 && $this->row[name_id] != 0):?>
                    <ul class="nav nav-tabs" id="pz">
                        <li class="active"><a href="javascript:;">参数配置</a></li>
                    </ul>
                    <table class="table table-striped" id="detail_arr">
                    	<tr><td><center class="loading"><i></i></td></tr>
                    </table>
                    <input type="hidden" value="<?= $this->row[name_id]?>" id="name_id" />
				    <p><small class="pull-right"><i class="icon-fullscreen"></i> <a href="<?= $this->url(array('controller'=>'cars','action'=>'detail','id'=>$this->row[name_id]), null,true)?>" target="_blank">查看详细参数配置</a></small></p>
                    <?php endif;?>
                </div>
            </div>
            
        </div>
    </div>
    
    <div class="row-fluid">
    <ul class="pager">
        <li class="previous hidden-phone">
        <?php if ($this->re_res):?>
            <a href="<?= $this->url(array('action'=>'view','cid'=>$this->re_res[0][id]))?>">&larr; <?= $this->re_res[0][title]?></a>
        <?php endif;?>
        </li>
        <li class="next">
        <?php if ($this->next_res):?>
            <a href="<?= $this->url(array('action'=>'view','cid'=>$this->next_res[0][id]))?>"><?= $this->next_res[0][title]?>  &rarr;</a>
        <?php endif;?>
        </li>
    </ul>
    </div>
    
<div class="row-fluid price_nav_top hidden-phone">
    <div class="span12 price_nav car_color ">
        
        <span class="pull-left">
        <h4>
            <img src="/car_ico/<?= $this->row[brand_icon]?>" /> 
            <span> <?= $this->row[title];?></span>
        </h4>
        <p>价格:<strong><?= $this->row[price]?></strong>万元
        <?= $this->row[car_year]."年".$this->row[car_month]."月";?>上牌
        <?= $this->row[kilometer]?>公里
        <?= $this->row[biansuxiang]?>
        <?= $this->row[pailiang]?>
        </p>
        </span>
        
        <p class="pull-right">
        <span id="view_tel" class="tel-number"> <b> <?= $this->row[contact_user]?></b> <label>点击查看联系电话</label> </span> 
        </p>
    </div>
</div>
    
    <div class="row-fluid view_bottom">
        <ul class="nav nav-tabs">
        	<li class="active"><a href="javascript:;">同价位二手车</a></li>
        </ul>
    	<ul class="inline">
    		<?php foreach ($this->sameprice as $value):?>
			<li>
    	        <a target="_blank" title="<?= $value[title]?>" href="<?= $this->url(array('action'=>'view','cid'=>$value[id]))?>" class="thumbnail"><img width="90%" src="<?= $value[img_dir].$value[session_id].'/'.$value[session_id].str_replace('.', '_small.', $value[car_img])?>">
    	        <b><?= $value[price]."万元"?></b>
    	        <p><?= $value[title]?></p>
    	        </a>
    	    </li>
           <?php endforeach;?>
    	</ul>
    	<ul class="nav nav-tabs">
    		<li class="active"><a href="javascript:;">推荐二手车</a></li>
        </ul>
    	<ul class="inline">
		<?php foreach ($this->samebrand as $value):?>
			<li>
    	        <a target="_blank" title="<?= $value[title]?>" href="<?= $this->url(array('action'=>'view','cid'=>$value[id]))?>" class="thumbnail"><img width="90%" src="<?= $value[img_dir].$value[session_id].'/'.$value[session_id].str_replace('.', '_small.', $value[car_img])?>">
    	        <b><?= $value[price]."万元"?></b>
    	        <p><?= $value[title]?></p>
    	        </a>
    	    </li>
        <?php endforeach;?>
    	</ul>
    </div>
    
    
    <div class="buy_bottom hidden-phone">
        	<p class="text-right">
				<small>
					<a href="javascript:getBProfit();" data-original-title="">[换一批]</a>
				</small>
			</p>
			<ul class="unstyled inline" id="bprofit_div">

			</ul>	
			<p class="text-right ">
				<small>
				淘车智能推广<a target="_blank" href="<?= $this->url(array('controller'=>'set','action'=>'profit'),null,true)?>" data-original-title="">[我要推广]</a>
				</small>
			</p>
    </div>

</div>



<div class="span3 hidden-phone all_right">
	<?php if ($this->row[company_id]):?>
    <div class="profit_top text-center">
	    <ul class="unstyled">
	    	<li><a href="" target="_blank" ><img src="http://pic.58.com/m1/bigimage/n_1397973660817201411.jpg"></a></li>
	    </ul>
	    <h4 class=""><a href="">揽胜国际车业</a></h4>
	    <ul class="unstyled company">
	        <li>联系人：周先生</li>
	    	<li>地址：上海市普陀区真南路628-638号 </li>
	    </ul>
	    <p class="text-center"><button class="btn btn-small" type="button"><i class="icon-map-marker"></i> 进入商家店铺</button></p>
	    
    </div>
    <?php endif;?>



<!-- Baidu Button BEGIN -->
<script type="text/javascript" id="bdshare_js" data="type=tools&amp;uid=785038" ></script>
<script type="text/javascript" id="bdshell_js"></script>
<script type="text/javascript">
document.getElementById("bdshell_js").src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion=" + Math.ceil(new Date()/3600000);
</script>
<!-- Baidu Button END -->